package cn.etynit.service.impl;

import cn.etynit.mms.feign.ExpenseService;
import cn.etynit.result.JsonResult;
import cn.etynit.service.IAnnunciateService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnnunciateServiceImpl implements IAnnunciateService {

    @Autowired
    private ExpenseService expenseService;

    /**
     * 缴费通知
     */
    @Override
    public void adviceCharge() {
        JsonResult jsonResult = expenseService.adviceCharge();
        List<String> strings = JSON.parseArray(JSONObject.toJSONString(jsonResult.getData()), String.class);
        for (String string : strings) {
            System.out.println(string);
        }

//        System.out.println("通知业主缴费成功！");
    }
}
